<?php

class Exts_Forms_User extends Exts_Form {

	public function init() {

		$this->addElement('text', 'username',
			array('required' => true)
		);



		$this->addElement('select', 'role_id',
			array('required' => true)
		);

		$roleModel = new Exts_Models_Roles();
		$this->role_id->setMultiOptions($roleModel->getAllToArray());

		$this->addElement('submit', 'enviar',
			array()
		);
	}

	public function forUpdate() {

		$this->addElement('password', 'password',
			array('required' => false)
		);
		return $this;
	}

	public function forCreate() {
		$this->addElement('password', 'password',
			array('required' => true)
		);
		return $this;
	}

}